package com.redmaple.config;

import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.stereotype.Component;

/**
 * @Description 访问接口报错
 * User must be authenticated with Spring Security before authorization can be completed.
 * 需要开发权限,允许所有的接口访问进来
 * @Author redMaple-gi
 * @Date 2020/6/19 14:13
 * @Version 1.0
 */
@Component
public class SecurityConfig extends WebSecurityConfigurerAdapter {

    @Override
    protected void configure(HttpSecurity http) throws Exception {
        http.authorizeRequests().antMatchers("/**")
                .fullyAuthenticated().and().formLogin();
    }
}